package com.example.produces.service.impl;

import com.example.produces.entity.Staff;
import com.example.produces.mapper.StaffMapper;
import com.example.produces.service.StaffService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional
public class StaffImpl implements StaffService {
    @Autowired
    private StaffMapper staffMapper;
    @Override
    public List<Staff> findAll() {
        List<Staff> staff=staffMapper.findAll();
        return staff;
    }

    @Override
    public void add(Staff staff) {
      staffMapper.add(staff);
    }

    @Override
    public Staff findOne(String name) {
        return staffMapper.findOne(name);
    }

    @Override
    public void upDate(Staff staff) {
       staffMapper.upDate(staff);
    }

    @Override
    public void delete(String name) {
      staffMapper.delete(name);
    }
}
